package com.example.mypc.fragmentdemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class SecondActivity extends AppCompatActivity {


    public static final String POSITION_TAG = "pos";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        int position = getIntent().getIntExtra(SecondActivity.POSITION_TAG, 0);
        MyDetailsFragment frg = (MyDetailsFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_details);
        frg.setSelectedOne(position);
    }



}
